#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <climits>
#define int long long 
#define x first 
#define y second 
using namespace std ;
typedef pair<int,int> PII;
const int N = 1e5 + 10;
int a[N];
PII p[N];
int ans = 0;
void solve()
{

    int n,k;
    cin >> n >> k;
    int q = n - k;
   // cout << q << endl;
    for(int i = 1; i * i <= q; i++)
    {
        if(q % i == 0)
        {
          if(i > k)   ans++;
          if((i != q/i) && (q/i > k)) ans++;
        }

    }
    cout << ans << endl;


}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int t = 1;
    //cin >> t;
    while(t -- ) solve();
    return 0;
}
